home *** CD-ROM | disk | FTP | other *** search
/ SGI Freeware 1999 August / SGI Freeware 1999 August.iso / dist / samba.idb / usr / samba / src / source / updatesmbpasswd.sh.z / updatesmbpasswd.sh
Encoding:
Linux/UNIX/POSIX Shell Script  |  1998-10-28  |  322 b   |  15 lines

  1. #!/bin/sh
  2. nawk 'BEGIN {FS=":"} 
  3. {
  4.     if( $0 ~ "^#" ) {
  5.         print $0
  6.     } else if( (length($4) == 32) && (($4 ~ "^[0-9A-F]*$") || ($4 ~ "^[X]*$") || ( $4 ~ "^[*]*$"))) {
  7.         print $0
  8.     } else {
  9.         printf( "%s:%s:%s:XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX:", $1, $2, $3);
  10.         for(i = 4; i <= NF; i++)
  11.             printf("%s:", $i)
  12.         printf("\n")
  13.     }
  14. }'
  15.